<div class="wrap">
 	<div id="icon-index" class="icon32"><br /></div><h2><?php echo ucwords(str_replace('_',' ',$this->uri->segment(1)));?> &raquo; <?php echo ucwords(str_replace('_',' ',$this->uri->segment(2)));?></h2>
</div>
<div id="wpbody-content">
    <div class="metabox-holder" id="dashboard-widgets">
            <div class="inside">
				<div id="filter_panel">
					<form action="<?php echo current_url();?>" method="get" name="SearchForm" id="SearchForm">
					<ul>
						<li>
							<span><?php echo lang('chords_id');?> :</span>
							<input type="text" name="chords_id" id="chords_id" value="<?php echo @$this->input->get('chords_id');?>"/>
						</li>
						<li>
							<span><?php echo lang('media_type');?> :</span>
							<select name="media_type_id" id="media_type_id">
								<option value=""><?php echo lang('select_option');?></option>
								<?php if(!empty($dataMediaType)) foreach($dataMediaType as $value):?>
									<option value="<?php echo $value->media_type_id;?>" <?php echo (@$this->input->get('media_type_id') == $value->media_type_id ? 'selected="selected"':'');?>><?php echo $value->media_type_name;?></option>
								<?php endforeach;?>
							</select>
						</li>															
						<li>
							<span><?php echo lang('chords_song_name');?> :</span>
							<input type="text" name="song_name" id="song_name" value="<?php echo @$this->input->get('song_name');?>"/>
						</li>
						<li>
							<span><?php echo lang('chords_artist_name');?> :</span>
							<input type="text" name="artist_name" id="artist_name" value="<?php echo @$this->input->get('artist_name');?>"/>
						</li>
						<li>
							<span><?php echo lang('chords_album_name');?> :</span>
							<input type="text" name="album_name" id="album_name" value="<?php echo @$this->input->get('album_name');?>"/>
						</li>																													
						<li>
							<span><?php echo lang('update_by');?> :</span>
							<input type="text" name="update_by" id="update_by" value="<?php echo @$this->input->get('update_by');?>"/>
						</li>						
					</ul>
					<br />
					&nbsp;&nbsp;<input type="submit" value="<?php echo lang('button_search');?>" class="button-primary"/>
					<input type="reset" value="<?php echo lang('button_reset');?>" class="button-primary"/>
					</form>
				</div>
				<div class="tablenav top">
					<div class="alignleft"><input type="button" onclick="javascript:parent.location='<?php echo current_url();?>/add'" class="button-primary" value="<?php echo lang('button_add');?>" />&nbsp;<input type="button" value="<?php echo lang('button_delete');?>" class="button-primary" onclick="javascript:delete_Form(this,'ListForm','<?php echo current_url();?>/delete')"/></div>
					<p class="search-box">
						<input type="button" onclick="javascript:toggleFilter(this);" class="button-primary" value="<?php echo lang('button_filter');?>" />
					</p>
				</div>		
				<form action="<?php echo current_url();?>/delete" method="post" name="ListForm" id="ListForm">
				<table cellspacing="0" class="wp-list-table widefat fixed">
					<thead>
					<tr>
						<?php 
							echo generate_th_orderby(array(
								array(
									'name' => '<input type="checkbox"/>',
									'templates' => 'checkbox'
								),
								array(
									'name' => lang('tools'),
									'templates' => 'tools'
								),
								array(
									'name' => lang('chords_id'),
									'orderby' => 'chords_id',
									'width' => 60
								),
								array(
									'name' => lang('chords_song_name'),
									'orderby' => 'song_name'
								),
								array(
									'name' => lang('chords_artist_name'),
									'orderby' => 'artist_name'
								),
								array(
									'name' => lang('chords_album_name'),
									'orderby' => 'album_name'
								),								
								array(
									'name' => lang('is_publish'),
									'orderby' => 'is_publish',
									'width' => 100									
								),							
								array(
									'name' => lang('update_by'),
									'orderby' => 'update_by',
									'width' => 150	
								),
								array(
									'name' => lang('update_date'),
									'orderby' => 'update_date'	
								)
							));
						?>
					</tr>
					</thead>
				
					<tfoot>
					<tr>
						<?php 
							echo generate_th_orderby(array(
								array(
									'name' => '<input type="checkbox"/>',
									'templates' => 'checkbox'
								),
								array(
									'name' => lang('tools'),
									'templates' => 'tools'
								),
								array(
									'name' => lang('chords_id'),
									'orderby' => 'chords_id',
									'width' => 60
								),
								array(
									'name' => lang('song_name'),
									'orderby' => 'song_name'
								),
								array(
									'name' => lang('artist_name'),
									'orderby' => 'artist_name'
								),
								array(
									'name' => lang('album_name'),
									'orderby' => 'album_name'
								),								
								array(
									'name' => lang('is_publish'),
									'orderby' => 'is_publish',
									'width' => 100									
								),							
								array(
									'name' => lang('update_by'),
									'orderby' => 'update_by',
									'width' => 150	
								),
								array(
									'name' => lang('update_date'),
									'orderby' => 'update_date'	
								)
							));
						?>																				
					</tr>
					</tfoot>
				
					<tbody>
						<?php
						if(!empty($dataResult)):
							foreach($dataResult as $key => $value):
						?>
							<tr>
								<th class="check-column clean-column" scope="row"><input name="id[]" value="<?php echo $value->chords_id;?>" type="checkbox" /></th>
								<td class="toolsets">
									<a href="<?php echo current_url().'/edit/'.$value->chords_id;?>" class="tools edit" title="<?php echo lang('tool_edit');?>"></a>
								</td>
								<td class=""><?php echo sprintf('%06d',$value->chords_id);?></td>
								<td class=""><?php echo $value->song_name;?></td>
								<td class=""><?php echo $value->artist_name;?></td>
								<td class=""><?php echo $value->album_name;?></td>
								<td class=""><?php echo ($value->is_publish ? '&radic;':'&Chi;');?></td>
								<td class=""><?php echo $value->update_by;?></td>								
								<td class=""><?php echo $value->update_date;?></td>								
							</tr>
							<?php
							endforeach;
						else: //not exists
							?>
							<tr valign="middle" class="alternate"><td colspan="9"><?php echo lang('no_data');?></td></tr>			
						<?php
						endif;
						?>
					</tbody>
				</table>
				<div class="tablenav bottom">
					<div class="pager"><?php echo $pager;?></div>
				</div>
				</form>
            </div><!-- wpbody inside -->
    </div><!-- wpcontent -->
</div><!-- wpbody-content -->